@extends('Admin.layouts.common')

@section('content')
    <div class="container">

        @if(count($errors))
            <div class="alert alert-danger">
                <ul>
                    @foreach($errors->all() as $err)
                        <li>{{ $err }}</li>
                    @endforeach
                </ul>
            </div>
        @endif

        <form method="post">
            {{ csrf_field() }}
            <div class="form-group required">
                <label class="control-label">上级分类</label>
                <select class="form-control" name="pid">
                    <option value="0" >无上级分类</option>
                    @foreach($cat as $c)
                        <option value="{{ $c->id}}">><?=str_repeat("&nbsp;",$c->level*4)?>{{ $c->cat_name}}</option>
                    @endforeach
                </select>
            </div>
            <div class="form-group required">
                <label class="control-label">是否导航显示</label>
                <label><input class="form-control" type="radio" name="nav" value="1" />是 </label>
                <label><input class="form-control" type="radio" name="nav" value="0" checked="" />否</label>
            </div>

            <div class="form-group required">
                <label class="control-label">分类名称</label>
                <input name="cat_name" type="text" class="form-control" value="">
            </div>

            <div class="form-group required">
                <label class="control-label">排序</label>
                <input name="pos" type="text" class="form-control" value="">
            </div>            
            <div class="form-group">
                <button class="btn btn-primary btn-block" type="submit">添加</button>
            </div>
        </form>
    </div>
@endsection